<template>
  <div class="nav-header">
    <i
      class="fold-menu"
      :class="isFold ? 'el-icon-s-fold' : 'el-icon-s-unfold'"
      @click="handleFoldClick"
    ></i>
    <div class="content">
      <div class="content-left"></div>
      <div class="content-right"></div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
export default defineComponent({
  emits: ['foldChange'],
  setup(props, { emit }) {
    const isFold = ref(false)
    // 图标点击，控制左侧菜单栏缩放
    const handleFoldClick = () => {
      isFold.value = !isFold.value
      emit('foldChange', isFold.value)
    }
    return { isFold, handleFoldClick }
  }
})
</script>

<style scoped lang="less">
.nav-header {
  display: flex;
  width: 100%;
  height: 59px;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid #e9e9e9;

  .fold-menu {
    font-size: 30px;
    cursor: pointer;
    color: #999999;
    padding: 0 15px;
  }
}
</style>
